<HTML>
<HEAD>
<TITLE>Examples From Java in a Nutshell, Second Edition</TITLE>
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">
<CENTER>
<H1>Examples From <I>Java in a Nutshell, Second Edition</I></H1>
</CENTER>

The Java programming examples linked below are from the book 
<A HREF="http://www.ora.com/catalog/books/javanut2">
<I>Java in a Nutshell, Second Edition</I></A>, by David Flanagan,
published by O'Reilly & Associates.

<P>
Although you can view the example source code online, by following the
links below, I recommend that you download the complete set of examples
so that you can work with them on your computer locally.  They are
available as a
<A HREF="http://www.ora.com/catalog/books/javanut2/examples/examples.zip">
zip file</A>
or as a
<A HREF="http://www.ora.com/catalog/books/javanut2/examples/examples.tar.gz">
gzipped tar file</A>.

<H2>Reporting Bugs</H2>

If you find any bugs in these examples, please send e-mail describing
the bug to <A HREF="mailto:bookquestions@ora.com">bookquestions@ora.com</A>.
If you have found a workaround to the problem, please include it.

<H2>Copyright</H2> 

The examples were written by David Flanagan, and are Copyright (c) 1997
by O'Reilly and Associates.
<P>
You may study, use, and modify these examples for any purpose.  This
means that you can use the examples, or modified versions of the
examples in your programs, and you can even sell those programs.  You
can distribute the source code to these examples, but only for
non-commercial purposes, and only as long as the copyright notice is
retained. This means that you can make them available on a public Web
site, for example, but that you cannot include them on a commercial
CD-ROM without the prior permission of O'Reilly and Associates.
<P>
Note that these examples are provided AS-IS, with absolutely NO WARRANTY
of any kind, either expressed or implied.

<H3>Example 1-2</H3><A HREF="ch01/Scribble.java">Scribble.java</A>:
an applet of intermediate complexity, used as an example in the
introductory chapter.

<H3>Example 2-3</H3><A HREF="ch02/throwtest.java">throwtest.java</A>:
an application that demonstrates how to define, throw, and handle
exceptions. This application doesn't do anything other than print out
some text, but you might want to study it and play around with it to
learn more about how exceptions work in Java. See the usage instructions
in the source code.

<H3>Example 6-1</H3><A HREF="ch06/FirstApplet.java">FirstApplet.java</A>:
the simplest possible applet.  Displays "Hello World"

<H3>Example 6-2</H3><A HREF="ch06/SecondApplet.java">SecondApplet.java</A>:
a fancier version of "Hello World"

<H3>Example 6-3</H3><A HREF="ch06/Scribble.java">Scribble.java</A>:
a simple applet with user interaction.  It allows the user to click and
scribble in the window.

<H3>Example 6-4</H3><A HREF="ch06/ColorScribble.java">ColorScribble.java</A>:
the scribble applet, with colors specified through applet parameters in
an HTML file.

<H3>Example 6-5</H3><A HREF="ch06/Soundmap.java">Soundmap.java</A>:
An applet that displays an image, plays a sound, and demonstrates
several other applet capabilities.

<H3>Example 7-1</H3><A HREF="ch07/Scribble1.java">Scribble1.java</A>:
a simple applet, using the Java 1.0 event model.

<H3>Example 7-2</H3><A HREF="ch07/Scribble2.java">Scribble2.java</A>:
the same applet, using the Java 1.1 event model.

<H3>Example 7-3</H3><A HREF="ch07/Scribble3.java">Scribble3.java</A>:
the applet using the Java 1.1 event model and inner classes.

<H3>Example 7-4</H3><A HREF="ch07/Scribble4.java">Scribble4.java</A>:
the applet using a low-level interface to the Java 1.1 event model.

<H3>Example 8-1</H3><A HREF="ch08/ScribbleFrame.java">ScribbleFrame.java</A>:
a relatively long application that demonstrates many of the new AWT
features of Java 1.1, and also demonstrates object serialization and
data compression.

<H3>Example 9-2</H3><A HREF="ch09/IntList.java">IntList.java</A>:
a simple datatype that defines custom serialziation and de-serialization
behavior for itself.

<H3>Example 10-1</H3><A HREF="ch10/MultiLineLabel.java">MultiLineLabel.java</A>:
a custom AWT component and Java Bean that displays a specified string of
text, using multiple lines, if the string contains newline characters.

<H3>Example 10-2</H3><A HREF="ch10/YesNoDialog.java">YesNoDialog.java</A>:
a bean that displays a dialog box.

<H3>Example 10-3</H3><A HREF="ch10/AnswerEvent.java">AnswerEvent.java</A>:
an event type used by the bean.

<H3>Example 10-4</H3><A HREF="ch10/AnswerListener.java">AnswerListener.java</A>:
the event listener interface used by the bean

<H3>Example 10-5</H3><A HREF="ch10/YesNoDialogBeanInfo.java">YesNoDialogBeanInfo.java</A>:
a BeanInfo class for the bean.

<H3>Example 10-6</H3><A HREF="ch10/YesNoDialogAlignmentEditor.java">YesNoDialogAlignmentEditor.java</A>:
a property editor class for one of the bean's properties.

<H3>Example 10-7</H3><A HREF="ch10/YesNoDialogMessageEditor.java">YesNoDialogMessageEditor.java</A>:
a property editor class for another of the bean's properties.

<H3>Example 10-8</H3><A HREF="ch10/YesNoDialogCustomizer.java">YesNoDialogCustomizer.java</A>:
a customizer class for the bean.

<H3>Example 11-1</H3><A HREF="ch11/ConvertEncoding.java">ConvertEncoding.java</A>:
an application that converts a file from one character encoding to another.

<H3>Example 11-3</H3><A HREF="ch11/Portfolio.java">Portfolio.java</A>:
a dummy stock portfolio program that demonstrates internationalization
of dates, times and numbers.

<H3>Example 11-4</H3><A HREF="ch11/SimpleMenu.java">SimpleMenu.java</A>:
a convenience class for simple creation of localized menus using
ResourceBundles. 

<H3>Example 11-5</H3><A HREF="ch11/Menus.properties">Menus.properties</A>
<A HREF="ch11/Menus_en_GB.properties">Menus_en_GB.properties</A>
<A HREF="ch11/Menus_fr.properties">Menus_fr.properties</A>:
property files that specify default, British, and French resource
bundles for simple menu creation.

<H3>Example 11-6</H3><A HREF="ch11/LocalizedError.java">LocalizedError.java</A>:
a class that displays a localized error message fora given exception
object, using the MessageFormat class.

<H3>Example 11-7</H3><A HREF="ch11/Errors.properties">Errors.properties</A>:
a sample property file used by the previous example

<H3>Example 12-1</H3><A HREF="ch12/ShowClass.java">ShowClass.java</A>:
a program that uses the Reflection API to show the fields and methods of
a class.

<H3>Example 12-2</H3><A HREF="ch12/UniversalActionListener.java">UniversalActionListener.java</A>:
an ActionListener implementation that uses reflection to invoke a named
method of an object.
